# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Breno Leitao <breno.leitao@gmail.com>
# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=ndctl
pkgver=80
pkgrel=0
pkgdesc="Utility library for managing the libnvdimm (non-volatile memory device) sub-system in the Linux kernel"
url="https://github.com/pmem/ndctl"
arch="all"
license="GPL-2.0-only AND LGPL-2.1-only"
depends="kmod"
makedepends="
	asciidoc
	asciidoctor
	bash-completion-dev
	eudev-dev
	iniparser-dev
	json-c-dev
	keyutils-dev
	kmod-dev
	libtraceevent-dev
	libtracefs-dev
	linux-headers
	meson
	util-linux-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-dev
	$pkgname-libs
	$pkgname-bash-completion
	"
source="ndctl-$pkgver.tar.gz::https://github.com/pmem/ndctl/archive/v$pkgver.tar.gz
	basename.patch
	no-bash.patch
        tracefs-include.patch
	"
options="!check" # tests require building & loading the nfit_test.ko kernel module

build() {
	abuild-meson \
		-Db_lto=true \
		-Dsystemd=disabled \
		-Dversion-tag="$pkgver" \
		. output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
f8302c0c64c0b30524cc62d5af35a81bca9ed9afb94e3a9a1848e976aabb0af0824f9a12080a522ab935665ccdbf2a18ed3ac6347343446385830dae9f5736a4  ndctl-80.tar.gz
225414bb48d30e9036bb4f84013c3f9a12cb58b996aedfb446c549c2839957d3670acbdc438a858c15067170378aba9575c54baacf5ad60f9de9f93f54bb84b6  basename.patch
cb48fdf9ff293164bf0ef52f38194d4bfb56eeec3f4cd173f4d3dd545ab17dcaeeb0362a3df700b519dc2c97407664094363faf76b900135eb24fed1ae4519fa  no-bash.patch
26143251a3a50f1b3ea528c447f8437b39863bd2f5e41280312bb39e8b4316e7a8c9bde2c1b94212bf4c05523fde25099aae51d318cd7a485c57f2a8a31a3096  tracefs-include.patch
"
